import { Role } from '@/enums/role.enum'
import { RoleGuard } from '@/guards/role.guard'
import { applyDecorators, UseGuards, SetMetadata } from '@nestjs/common'
import { AuthGuard } from '@nestjs/passport'


export function LvAuth(...roles: Role[]) {
  return applyDecorators(SetMetadata('roles', roles),
  UseGuards(AuthGuard('jwt'), RoleGuard))
}